/**
 * Created by shi.pengyan on 2016-12-29.
 */

import * as types from './appointmentsMutationTypes';

/**
 * mutations
 * @type {{}}
 */
const mutations = {
  [types.APPOINTMENT_QUERY_APPOINTMENTS_BEGIN](state, data) {
    state.appointments = [];
    state.pageSize = data.pageSize;
  },
  [types.APPOINTMENT_QUERY_APPOINTMENTS_SUC](state, page) {
    state.appointments = page.records;
    state.currentPage = page.pageNow;
    state.totalCount = page.rowCount;
  },
  [types.APPOINTMENT_QUERY_APPOINTMENTS_TOTALCOUNT_BEGIN](state) {
  },
  [types.APPOINTMENT_QUERY_APPOINTMENTS_TOTALCOUNT_SUC](state, data) {
    state.totalCount = data.totalCount;
  },
  [types.APPOINTMENT_QUERY_APPOINTMENT_BEGIN](state) {

  },
  [types.APPOINTMENT_QUERY_APPOINTMENT_SUC](state, data) {
    console.log('query user suc', data);

    state.form = data.user;
  }

};

export default mutations;
